<?php

/**
 * Description of item_model
 *
 * @author Life Hazard
 */
class Kas_Penjualan_Model extends Default_My_Model{
    
    public function __construct() {
        parent::__construct();
    }
    
    function item_list(){
        return $this->db->query("SELECT sjkp.id_sjkp,jkp.nama_jkp, sjkp.nama_sjkp FROM jenis_kas_penjualan jkp join sub_jenis_kas_penjualan sjkp on jkp.id_jkp = sjkp.id_jkp WHERE true ".($whr ? " AND $whr " : "")." ORDER BY jkp.nama_jkp, sjkp.nama_sjkp ");
    }
    
    function count_item_list(){
        return $this->get_scalar("SELECT COUNT(id_sjkp) as total FROM jenis_kas_penjualan jkp join sub_jenis_kas_penjualan sjkp on jkp.id_jkp = sjkp.id_jkp WHERE true ".($whr ? " AND $whr " : ""), "total");
    }
    
}

?>
